package com.xcw.controller;

import com.xcw.entity.req.UserLoginParams;
import com.xcw.entity.contanst.Contanst;
import com.xcw.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author bhx
 * @Date 2022/6/25 2:22
 * @Description TODO
 */
@RestController
@RequestMapping("/user")
@Slf4j
public class RegisterController {

    @RequestMapping(value = "/register", method = RequestMethod.POST)
    public Result register(@RequestBody UserLoginParams userLoginParams){
        if(!(StringUtils.hasText(userLoginParams.getUserName()) && StringUtils.hasText(userLoginParams.getPassword()))) {
            return Result.error(Contanst.USERNAMEORPASSWORD, "用户名或密码不能为空！");
        }


        return null;
    }
}